package com.quark.model.system.dict;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * @author 张高昌
 * @version 版本
 * @date 2022/01/13 12:19
 * @description: 字典项
 */
@Data
@ApiModel(value = "字典项")
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_dict_item")
public class SysDictItem extends Model<SysDictItem> {

    /**
     * 编号
     */
    @TableId(value="id",type = IdType.AUTO)
    @ApiModelProperty(value = "字典项id")
    private Integer id;

    /**
     * 所属字典类id
     */
    @NotNull(message = "所属字典类id不能为空")
    @ApiModelProperty(value = "所属字典类id")
    private Integer dictId;

    /**
     * 数据值
     */
    @NotBlank(message = "数据值不能为空！")
    @ApiModelProperty(value = "数据值")
    private String value;

    /**
     * 标签名
     */
    @NotBlank(message = "标签名不能为空！")
    @Length(min = 2, max = 15)
    @ApiModelProperty(value = "标签名")
    private String label;

    /**
     * 类型
     */
    @NotBlank(message = "类型不能为空！")
    @Length(min = 2, max = 15)
    @ApiModelProperty(value = "类型")
    private String type;

    /**
     * 描述
     */
    @ApiModelProperty(value = "描述")
    private String description;

    /**
     * 排序（升序）
     */
    @NotBlank(message = "排序值不能为空！")
    @ApiModelProperty(value = "排序值，默认升序")
    private Integer sort;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updateTime;

    /**
     * 备注信息
     */
    @ApiModelProperty(value = "备注信息")
    private String remarks;

    /**
     * 删除标记
     */
    @TableLogic
    @ApiModelProperty(value = "删除标记,1:已删除,0:正常")
    private String delFlag;

    private static final long serialVersionUID = 1L;
}
